Previous Book Contents Book Index Next

Inside Macintosh: QuickDraw GX Objects /
Chapter 3 - Style Objects / Style Objects Reference
Functions / Creating and Manipulating Style Objects


GXCopyToStyle

You can use the GXCopyToStyle function to create a copy of an existing style object.

gxStyle GXCopyToStyle(gxStyle target, gxStyle source);
target
A reference to the style object to copy the source style object's contents into. If you specify nil for this parameter, this function creates a new style object.
source
A reference to the style object whose contents you want to copy.
function result
A reference to the copy (that is, the target style).
DESCRIPTION
The GXCopyToStyle function copies the contents of an existing style object to another, or it creates a new style object and copies the contents of an existing style object into it. The function copies the stylistic and typographic properties and the tag list (but not the owner count) of the style object specified by the source parameter into the style object specified by the target parameter. It clones, but does not copy, the tag objects in the tag list.

If you specify nil for the target parameter, the GXCopyToStyle function creates a new style object and copies the source properties, including tag list, into it. The function gives the new style object an owner count of 1.

You can use the GXCopyToStyle function to create a copy of a style object in order to modify it without changing the original.

SPECIAL CONSIDERATIONS
If you specify nil for the target parameter and no error occurs, the GXCopyToStyle function creates a style object; you are responsible for disposing of that object when you no longer need it.

ERRORS, WARNINGS, AND NOTICES
Errors 
out_of_memory 
style_is_nil 
SEE ALSO
To create a new style that is a copy of the default style instead of a copy of an existing style, use the GXNewStyle function, described on page 3-17.

To compare two style objects, use the GXEqualStyle function, described in the next section.


Previous Book Contents Book Index Next

© Apple Computer, Inc.
7 JUL 1996